package com.hooda.servlet;

import com.hooda.server.Request;
import com.hooda.server.Response;
import com.hooda.servlet.HttpServlet;
import com.hooda.utils.HttpProtocolUtil;

import java.io.IOException;

/**
 * @author zhangzp
 * @version 1.0, 2021/10/11
 */
public class NotFoundServlet extends HttpServlet {

    @Override
    public void doGet(Request request, Response response) {
        doPost(request, response);
    }

    @Override
    public void doPost(Request request, Response response) {
        try {
            response.outputHtml(request.getContext().getDir() + request.getUrlPattern());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
